home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / dmedia / dmDVIAudioDecode.z / dmDVIAudioDecode
Encoding:
Text File  |  1998-10-20  |  11.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((3333ddddmmmm))))                                    ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      dmDVIAudioDecode - decode audio data compressed using the IMA
  10.      (Interactive Multimedia Association) Recommended ADPCM decompression,
  11.      based on Intel's DVI algorithm.
  12.  
  13.  
  14. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ddddmmmm____aaaauuuuddddiiiioooouuuuttttiiiillll....hhhh>>>>
  16.  
  17.      DDDDMMMMssssttttaaaattttuuuussss ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((DDDDMMMMDDDDVVVVIIIIaaaauuuuddddiiiiooooddddeeeeccccooooddddeeeerrrr hhhhaaaannnnddddlllleeee,,,,
  18.                                uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr ****iiiibbbbuuuuffff,,,, sssshhhhoooorrrrtttt ****oooobbbbuuuuffff,,,,
  19.                                iiiinnnntttt nnnnssssaaaammmmpppplllleeeessss))))
  20.  
  21.  
  22. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRR
  23.      _h_a_n_d_l_e    DDDDMMMMDDDDVVVVIIIIaaaauuuuddddiiiiooooddddeeeeccccooooddddeeeerrrr structure, created by a previous call to
  24.                ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeeerrrrCCCCrrrreeeeaaaatttteeee((((3333ddddmmmm)))).  It contains the state associated
  25.                with the decoder.
  26.  
  27.  
  28.      _i_b_u_f      A pointer to the compressed input data buffer. The data format
  29.                is unsigned char (8-bit).
  30.  
  31.  
  32.      _o_b_u_f      A pointer to the output sample data buffer.  The data format is
  33.                short (16-bit).  The samples are assumed to be two's
  34.                complement.  Sampling rate may range from 8 kHz to 48 kHz, but
  35.                has to be the same as encoder.
  36.  
  37.  
  38.      _n_s_a_m_p_l_e_s  The number of samples to be processed.  For the 4:1 algorithm
  39.                (the only one currently supported), the value of nsamples
  40.                passed to the DVI encode/decode routines must always be a
  41.                multiple of 2.
  42.  
  43.  
  44. RRRREEEETTTTUUUURRRRNNNNEEEEDDDD VVVVAAAALLLLUUUUEEEE
  45.      Returns DDDDMMMM____FFFFAAAAIIIILLLLUUUURRRREEEE or DDDDMMMM____SSSSUUUUCCCCCCCCEEEESSSSSSSS.
  46.  
  47.  
  48. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  49.      ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((3333ddddmmmm)))) implements Intel, Inc.'s DVI IMA4:1 ADPCM
  50.      compression for monaural audio data.
  51.  
  52.      DVI IMA ADPCM compression exists in two forms, 4 bits per sample (IMA4:1)
  53.      and 3 bits per sample (IMA3:1).  The compression form may be retrieved
  54.      using ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeeerrrrGGGGeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))) via the parameter
  55.      DDDDMMMM____DDDDVVVVIIII____AAAAUUUUDDDDIIIIOOOO____BBBBIIIITTTTSSSS____PPPPEEEERRRR____SSSSAAAAMMMMPPPPLLLLEEEE.  Its possible values are:
  56.  
  57.      DDDDMMMM____DDDDVVVVIIII____AAAAUUUUDDDDIIIIOOOO____4444BBBBIIIITTTTSSSS____PPPPEEEERRRR____SSSSAAAAMMMMPPPPLLLLEEEE
  58.           4:1 compression.  This is the only form currently supported by the
  59.           SGI Digital Media libraries.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((3333ddddmmmm))))                                    ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      DDDDMMMM____DDDDVVVVIIII____AAAAUUUUDDDDIIIIOOOO____3333BBBBIIIITTTTSSSS____PPPPEEEERRRR____SSSSAAAAMMMMPPPPLLLLEEEE
  75.           3:1 compression.  Currently not supported.
  76.  
  77. DDDDVVVVIIII AAAAUUUUDDDDIIIIOOOO FFFFIIIILLLLEEEE BBBBLLLLOOOOCCCCKKKK MMMMOOOODDDDEEEE
  78.      DVI audio compression uses a linear prediction scheme.  This means that
  79.      the compressed bits are interrelated or interdependent.  If a application
  80.      seeks to an offset into the compressed bit stream file and then starts
  81.      reading at that point in the stream and decompresses it via
  82.      ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((3333ddddmmmm)))), the interdependency of the bits at the start point
  83.      is lost.  The application will initially get back data with a lower
  84.      amplitude than if he had read the same data back during a complete pass
  85.      over the file from the beginning.
  86.  
  87.      In pure DVI ADPCM data, there is no way to accurately begin decoding data
  88.      in the middle of the bit stream file without starting the beginning.  Two
  89.      solutions to this problem have been developed, one by Intel, Inc. and one
  90.      by Apple, Inc.  Both involve breaking the compressed data up into blocks,
  91.      each with a small header encapsulating the information needed to allow
  92.      decoding to begin at any block boundry with no loss of data. WWWWAAAAVVVVEEEE(4) and
  93.      AAAAIIIIFFFFFFFF----CCCC(4) format sound files using IMA DVI compression take advantage of
  94.      this block method, and if such a file is read using the Audio File
  95.      Library, accurate file seeks are possible.
  96.  
  97.      The data contained in one of these files may also be decoded accurately
  98.      using ddddmmmmAAAACCCCCCCCoooonnnnvvvveeeerrrrtttt(3dm) if it is configured properly.
  99.  
  100. CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG DDDDMMMMAAAACCCC TTTTOOOO PPPPAAAARRRRSSSSEEEE IIIINNNN BBBBLLLLOOOOCCCCKKKK MMMMOOOODDDDEEEE
  101.      Three parameters are needed to configure the DDDDMMMMaaaauuuuddddiiiiooooccccoooonnnnvvvveeeerrrrtttteeeerrrr to allow
  102.      parsing of these block streams:
  103.  
  104.      DDDDMMMM____AAAAUUUUDDDDIIIIOOOO____CCCCOOOODDDDEEEECCCC____MMMMAAAAXXXX____BBBBYYYYTTTTEEEESSSS____PPPPEEEERRRR____BBBBLLLLOOOOCCCCKKKK
  105.           Indicates the number of bytes of compressed data per block,
  106.           including the header.  For AAAAIIIIFFFFFFFF----CCCC(4) files, this value is always 34
  107.           * channel_count.  For WWWWAAAAVVVVEEEE(4) files, this value varies.  If
  108.           aaaaffffOOOOppppeeeennnnFFFFiiiilllleeee(3dm) is used to open a WWWWAAAAVVVVEEEE(4) file, the value of this
  109.           parameter can be retrieved directly using aaaaffffGGGGeeeettttFFFFoooorrrrmmmmaaaattttPPPPaaaarrrraaaammmmssss(3dm).
  110.  
  111.      DDDDMMMM____AAAAUUUUDDDDIIIIOOOO____CCCCOOOODDDDEEEECCCC____FFFFRRRRAAAAMMMMEEEESSSS____PPPPEEEERRRR____BBBBLLLLOOOOCCCCKKKK
  112.           Indicates the number of frames of uncompressed data contained in
  113.           each block.  For AAAAIIIIFFFFFFFF----CCCC(4) files, this value is always 64.  For
  114.           WWWWAAAAVVVVEEEE(4) files, this value varies.  If aaaaffffOOOOppppeeeennnnFFFFiiiilllleeee(3dm) is used to
  115.           open a WWWWAAAAVVVVEEEE(4) file, the value of this parameter can be retrieved
  116.           directly using aaaaffffGGGGeeeettttFFFFoooorrrrmmmmaaaattttPPPPaaaarrrraaaammmmssss(3dm).
  117.  
  118.      DDDDMMMM____DDDDVVVVIIII____AAAAUUUUDDDDIIIIOOOO____BBBBLLLLOOOOCCCCKKKK____TTTTYYYYPPPPEEEE
  119.           This DVI-specific parameter specifies whether the data is compressed
  120.           using the Intel scheme, the Apple scheme, or no blocking at all
  121.           (i.e., "pure" DVI).  Its possible values are:
  122.  
  123.           DDDDMMMM____DDDDVVVVIIII____AAAAUUUUDDDDIIIIOOOO____BBBBLLLLOOOOCCCCKKKK____TTTTYYYYPPPPEEEE____NNNNOOOONNNNEEEE -- For stream use only.
  124.           DDDDMMMM____DDDDVVVVIIII____AAAAUUUUDDDDIIIIOOOO____BBBBLLLLOOOOCCCCKKKK____TTTTYYYYPPPPEEEE____AAAAPPPPPPPPLLLLEEEE -- For AIFF-C files.
  125.           DDDDMMMM____DDDDVVVVIIII____AAAAUUUUDDDDIIIIOOOO____BBBBLLLLOOOOCCCCKKKK____TTTTYYYYPPPPEEEE____IIIINNNNTTTTEEEELLLL -- For WAVE files.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((3333ddddmmmm))))                                    ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee((((3333ddddmmmm))))
  137.  
  138.  
  139.  
  140. IIIIMMMMPPPPOOOORRRRTTTTAAAANNNNTTTT NNNNOOOOTTTTEEEE
  141.      Stereo audio streams and streams with block data _c_a_n_n_o_t be parsed using
  142.      ddddmmmmDDDDVVVVIIIIAAAAuuuuddddiiiiooooDDDDeeeeccccooooddddeeee(((()))) directly -- you must use ddddmmmmAAAACCCCCCCCoooonnnnvvvveeeerrrrtttt(3dm).  It is
  143.      highly recommended that the Audio File Library be used for all to- and
  144.      from-disk compression and decompression.
  145.  
  146. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  147.      dmDVIAudioDecoderCreate(3dm), dmDVIAudioDecoderSetParams(3dm),
  148.      dmDVIAudioDecoderDestroy(3dm), dmDVIAudioEncode(3dm),  afReadFrames(3dm),
  149.      IMA Recommended Practices for Enhancing Digital Audio Compatibility in
  150.      Multimedia Systems, rev 3.00.
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.